This invention relates to an image processing apparatus and an image processing method and can be applied to an image processing apparatus such as, for example, a television receiver, a video tape recorder, a television camera and a printer.
Conventionally, an image processing apparatus such as a television camera corrects the gradation of image data obtained from an image inputting apparatus such as an image pickup apparatus and outputs the image data of the corrected gradation.
FIG. 19 is a characteristic diagram showing an input/output characteristic of a signal processing circuit adapted to such gradation correction processing. A signal processing circuit of the type described decreases the gain when the input level L increases higher than a predetermined reference level Lk. Consequently, a signal processing-circuit of the type described suppresses the signal level and outputs the signal of the suppressed signal level when the input level is higher than the reference level Lk. In this instance, the gradation is corrected sacrificing the contrast at a portion of an image having a comparatively high signal level.
In the characteristic diagram of FIG. 19, the axis of abscissa represents the pixel value L which is the input level of image data while the axis of ordinate represents the pixel value T(L) which is the output level of the image data, and Lmax represents the maximum level which can be taken by any pixel of the input/output images. In the following description, a function indicative of an input/output relationship as represented by the characteristic diagram of FIG. 19 is referred to as level conversion function.
FIG. 20 is a characteristic diagram showing an input/output characteristic of, another signal processing circuit of a similar type. The signal processing circuit which uses the level conversion function illustrated in FIG. 20 decreases the gain when the input level L is lower than a first reference level Ls and when the input level L is higher than a second reference level Lb. Consequently, the signal processing circuit corrects the gradation sacrificing the contrast where the signal level is comparatively low and where the signal level is comparatively high with respect to an intermediate range of the input signal level.
On the other hand, in image processing and so forth wherein a computer is used, the gradation is corrected, for example, by histogram equalization.
The histogram equalization is a method of adaptively varying the level conversion function in response to the frequency distribution of a pixel value of an input image, and corrects the gradation by reducing the gradation at a portion where the frequency distribution of the pixel value is low.
Referring to FIG. 21, in processing of the histogram equalization, a cumulative frequency distribution C(L) by arithmetic processing of the following expression (1) is detected based on a frequency distribution H(L) which is an aggregate of the number of pixels with reference to the pixel value L of the input image:                               C          ⁡                      (            L            )                          =                              ∑                          k              =              0                        L                    ⁢                      xe2x80x83                    ⁢                      H            ⁡                          (              k              )                                                          (        1        )            
In the processing of the histogram equalization, the cumulative frequency distribution C(L) detected in this manner is normalized by processing with the following expression (2) to define a level conversion function T(L), and the signal level of the input image is corrected in accordance with the level conversion function T(L).                               T          ⁡                      (            L            )                          =                                            C              ⁡                              (                L                )                                                    F              ⁢                              xe2x80x83                            ⁢              max                                xc3x97          L          ⁢                      xe2x80x83                    ⁢          max                                    (        2        )            
where Fmax is the final value of the cumulative frequency distribution C(L), and Lmax is the maximum value of the input/output levels.
Such processing of correcting the gradation as described above is executed suitably in accordance with the necessity, for example, in order to suppress the dynamic range or for some other object when image data are transmitted over a transmission line, when image data are displayed on a display unit, when image data are stored into a storage device or in a like case.
In the correction processes of the gradation according to the conventional techniques described above, the entire gradation is corrected sacrificing the contrast at some portion of the input image. This is because, with any of the techniques, the level is converted with an input/output function having a monotone increasing property in order to prevent production of an unnatural image.
Accordingly, the conventional techniques have a problem in that an image obtained by processing finally has a partially reduced contrast.
It is an object of the present invention to provide an image processing apparatus and an image processing method by which the gradation can be corrected while effectively preventing a finally obtained image from partial deterioration of the contrast.
In order to attain the object described above, according to the present invention, an area to which image data belong is discriminated, for example, with reference to a low frequency component of a pixel value to produce a correction coefficient, and such correction coefficients are smoothed between frames to correct the pixel values of the image data so that the gradation also of a moving picture can be corrected while preventing partial deterioration in contrast effectively.
More particularly, in an image processing apparatus and an image processing method according to an aspect of the present invention, an area to which image data belong is discriminated, and a correction coefficient to be used for correction of a pixel value of the image data is produced based on a result of the discrimination, and then such correction coefficients are smoothed between corresponding image data of successive frame and the pixel values of the image data are corrected with the smoothed correction coefficient.
Where an area to which image data belong is discriminated and a correction coefficient to be used for correction of a pixel value of the image data is produced based on a result of the discrimination and then the pixel value of the image data is corrected with the correction coefficient, the pixel values in the same area can be corrected with the same coefficient to maintain the relationship in magnitude among the pixel values in the area, but the relationship in magnitude between pixel values which belong to different areas can be varied, for example, reversed. Consequently, the gradation of the entire image can be corrected while preventing partial deterioration of the contrast. In this instance, where such correction coefficients which correspond to each other are smoothed between corresponding image data of successive frames, the gradation of an entire image can be corrected without giving any unnatural feeling even if the image involves some motion.